<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
          name="viewport">

    <title>申请售后</title>
    <link rel="stylesheet" href="../css/base.css">
    <script src="../js/jquery-1.8.3.min.js"> </script>
    <script src="../js/public.js"></script>
    <script src="../js/exif.js"></script>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    body{
        background: #fff;
    }
    .ti{
        color: #5f3104;
        padding: 0 .2rem;
        box-sizing: border-box;
        font-size: 12px;
        line-height: .88rem;
    }
    .tk-obj{
        padding: 0 .2rem;
        box-sizing: border-box;
        line-height: .88rem;
        position: relative;
    }
    .sele{
        position: absolute;
        height: .88rem;
        top: 0;
        left: .2rem;
        width: 90%;
        opacity: 0;
    }
    .triangle-down {
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid #999;
        display: inline-block;
        margin-top: .05rem;
        position: absolute;
        right: .2rem;
        top: 0.35rem;
    }
    .money{
        padding: 0 .2rem;
        box-sizing: border-box;
    }
    /*.footer-btn{*/
        /*background: #5f3104;*/
        /*height: .64rem;*/
        /*border-radius: .04rem;*/
        /*line-height: .64rem;*/
        /*color: #fff;*/
        /*text-align: center;*/
        /*width: 80%;*/
        /*margin: 20px auto;*/
    /*}*/

    .upload_box {
        width: 100%;
        /* margin: 1em auto; */
    }
    .Publish_goods textarea{
        font-size: 14px;
    }
    body{
        background: #fff;
    }

    .upload_drag_area {
        display: inline-block;
        width: 60%;
        padding: 4em 0;
        margin-left: .5em;
        border: 1px dashed #ddd;
        background: #fff url(drag.png) no-repeat 20px center;
        color: #999;
        text-align: center;
        vertical-align: middle;
    }

    .upload_drag_hover {
        border-color: #069;
        box-shadow: inset 2px 2px 4px rgba(0, 0, 0, .5);
        color: #333;
    }

    .upload_preview {
        background-color: #fff;
        overflow: hidden;
        _zoom: 1;
        float: left;
    }

    .upload_append_list {
        /* height: 300px; */
        margin-right: 8px;
        width: 60px;
        height: 60px;
        float: left;
        position: relative;
    }

    .upload_devare {
        margin-left: 2em;
        background: url('../img/删除@2x.png') no-repeat center;
        position: absolute;
        top: 0;
        right: 0;
        display: inline-block;
        width: 12px;
        height: 12px;
        background-size: contain;
    }



    .upload_submit_btn {
        display: none;
        height: 32px;
        font-size: 14px;
    }

    .upload_loading {
        height: 250px;
        background: url(http://www.zhangxinxu.com/study/image/loading.gif) no-repeat center;
    }

    .upload_progress {
        display: none;
        padding: 5px;
        border-radius: 10px;
        color: #fff;
        background-color: rgba(0, 0, 0, .6);
        position: absolute;
        left: 25px;
        top: 45px;
    }
    .upimg{
        width: 60px;
        height: 60px;
    }
    .footer-btn-fl{
        line-height: 49px;
        color: #fff;
        height: 49px;
        text-align: center;
        width: 50%;
        float: left;
    }
    .footer-btn-fr{
        line-height: 49px;
        color: #fff;
        height: 49px;
        text-align: center;
        width: 50%;
        float: right;
        background: #baabab;
    }
    .footer-btn{
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: #5f3104;
        height: 49px;
    }
    .ag-div{
        width: 80%;
        left: 10%;
        right: 10%;
        top: 30%;
        position: fixed;
        z-index: 1111;
    }
    .fls{
        width: 48%;
        display: inline-block;
        text-align: center;
        background:#5f3104 ;
        color: #fff;
        line-height: 40px;
    }
    .divss{
        width: 50%;
        float: left;
        text-align: center;
    }
    .spanss{
        display: inline-block;
        text-align: center;
        background: #5F3104;
        color: #fff;
        line-height: .32rem;
        padding: .2rem .4rem;
        box-sizing: border-box;
        border-radius: .04rem;
    }
    #showhtmltype{
    	padding: 0 0.2rem;
    }
</style>
<body>

<div class="tk-obj" style="display: none;">
    <div class="ti">
        退款类型
    </div>
    <div id="showhtmltype">
        我要退款和退货
    </div>

<div class="ti">
    退款说明
</div>
<div  id="showtext" style="padding: 0 .2rem;box-sizing: border-box">

</div>
<div class="ti">
    退款单号
</div>
<div id="orderNum"  style="padding: 0 10px;box-sizing: border-box">

</div>
<div class="ti">
    退款金额
</div>

<div id="tktotal" style="padding: 0 10px;box-sizing: border-box">

</div>

<div style="padding: 0 .2rem;box-sizing: border-box">
    <img src="" alt="" id="imgss" style="width: 60px;height: 60px;">
</div>
</div>
<div class="tk-obj2" style="display: none;">
    <div class="ti">
        退款类型
    </div>
    <div style="padding: 0 .2rem;box-sizing: border-box">
        我要退款和退货
    </div>
    <div class="ti">
        退款金额
    </div>
    <div id="tkje" style="padding: 0 .2rem;box-sizing: border-box;">

    </div>
    <div class="ti">
        物流单号
    </div>
    <div id="trackNum" style="padding: 0 .2rem;box-sizing: border-box;">

    </div>
    <div style="margin-top: 40px;">
        <div class="divss">
            <span class="spanss" onclick="trsh()">确认收货</span>
        </div>
        <div class="divss">
            <span class="spanss" style="background: #fa4535;" onclick="ckwl()">查看物流</span>
        </div>
    </div>
</div>

<div id="overlay">

</div>
<div class="ag-div" style="display: none;">
    <div style="text-align: center;">
        <textarea style="width: 100%;" name="" id="" cols="30" rows="10" placeholder="请填写不同意的原因"></textarea>
    </div>
    <div>
        <span class="fls">确认</span>
        <span class="fls">取消</span>
    </div>
</div>
<div class="footer-btn">
    <div class="footer-btn-fl" onclick="agreeClick()">
        同意
    </div>
    <div class="footer-btn-fr" onclick="noagreeClick()">
        拒绝
    </div>
</div>
<script>

    var oid = GetQueryString('oid');
    var status = GetQueryString('status');
    var price = GetQueryString('price');
    var trackNum = GetQueryString('trackNum');
    var img = GetQueryString('img');
    $("#tkje").text(price);
    $("#trackNum").text(trackNum);
    if(status == 4){
        $(".tk-obj2").show();
        $(".footer-btn").hide();

//        $(".footer-btn").hide();
    }else{
        //获取售后详情信息
        $(".tk-obj").show();
        $.ajax({
            url:base_url+"ZITAOHUI/displayCustomerServiceMsg",
            data:{
                userId:sessionStorage.getItem("uid"),
                order_id:oid
            },
            dataType:"json",
            success:function (data){
                console.log(data);
                var _d = data.extend.list[0];
                $("#tktotal").text(_d.orderTotalPrice);
                $("#orderNum").text(_d.orderNum);
                $("#showtext").text(_d.reason);
                $("#imgss").attr("src",_d.image[0].produceImages);
            }
        })
    }

        function agreeClick(){
            $.ajax({
                url:base_url+"ZITAOHUI/sellerAgrees",
                type:"post",
                data:{
                    order_id:oid
                },
                dataType:"json",
                success:function (data){
                    if(data.code == 1){
                        alert("提交成功");
                        window.history.back();
                    }
                }
            })
        }
        function noagreeClick(){
            $.ajax({
                url:base_url+"ZITAOHUI/sellersDisagree",
                type:"post",
                data:{
                    order_id:oid,
                    disagreeMsg:'暂未填写原因'

                },
                dataType:"json",
                success:function (data){
                    if(data.code == 1){
                        alert("提交成功");
                        window.history.back();
                    }
                }
            })
        }
        function trsh (){
            //确认收获

            $.ajax({
                url:base_url+"ZITAOHUI/sellerConfirmsReceipt",
                type:"post",
                data:{
                    orderId:oid
                },
                success:function (data){
                    if(data.code == 1){
                        alert("确认完成");
                        window.location.href ="../page/Seller-order.html?tab_num=4" 
                    }else{
                        alert("确认失败");
                    }
                },
                error:function (err){

                }
            })
        }
        function ckwl (){
            window.location.href = "View-Logistics.html?oid="+oid+"&img="+img;
        }
</script>
</body>
</html>